<template>
  <div class="boxs">
    <div class="preface-content">
      <div class="preface-left">
        <img
          @click="pathChild(props.info.children[0])"
          class="preface-left-img"
          :src="
            props.info.children[0].value
              ? urls + props.info.children[0].value + '?imageView2/1/w/480/h/480/format/webp'
              : 'http://101.34.143.36:8890/api/image/387939155165253/h_480,w_480'
          "
          alt=""
        />
      </div>
      <div class="preface-right">
        <div>
          <titles :title="props.info.text" style="margin-bottom: 32px" />
          <textMax :data="props.info.remarks" :maxLen="80" />
        </div>
        <div
          @click="pathChild(props.info.children[0])"
          class="float-box"
          :style="{ background: store.styleInfo.auxiliaryColor }"
        >
          <span
            class="float-title"
            :style="{
              fontFamily: store.styleInfo.textFamily,
              color: store.styleInfo.fontColor,
            }"
            >{{ props.info.children[0].text }}</span
          >
          <span
            class="left-title"
            :style="{
              fontFamily: store.styleInfo.fontFamily,
              fontSize: store.styleInfo.mintitleSize,
            }"
            >{{ props.info.children[0].remarks }}</span
          >
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// @ts-nocheck
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';

const router = useRouter();
const route = useRoute();
const props = defineProps({
  info: {
    type: Object,
  },
});
const title = '';
const store = useProjectStore();
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.boxs {
  // height: 480px;
  // margin-bottom: 50px;
}

.preface-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.preface-content {
  display: flex;
  width: 100%;
  margin-top: 50px;
  .preface-left {
    width: 480px;
    height: 480px;
    .preface-left-img {
      width: 480px;
      height: 480px;
    }
  }
  .preface-right {
    position: relative;
    display: flex;
    flex-direction: column;
    // align-items: center;
    // justify-content: center;
    flex: 1;
    margin-left: 36px;
  }
}
.float-box {
  display: flex;
  flex-direction: column;
  margin-top: 100px;
  padding: 50px 102px;
  margin-left: -100px;
  height: 332px;
  background: #fff !important;
}
.title1 {
  margin-bottom: 24px;
}
.left-btn {
  width: 165px;
  height: 48px;
  margin-top: 54px;
}
.title {
  margin-bottom: 32px;
}
.left-title {
  margin-bottom: 50px;
  font-size: 16px;
  font-family: SourceHanSerifCN-Medium, SourceHanSerifCN;
  font-weight: 500;
  color: #333333;
  line-height: 28px;
}
.float-title {
  margin-bottom: 24px;
  font-size: 20px;
}
</style>
